.class Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;
.super Ljava/lang/Object;
.source "ChromeCastImpl.java"

# interfaces
.implements Lcom/google/android/gms/common/api/d$b;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/estrongs/chromecast/ChromeCastImpl;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ConnectionCallbacks"
.end annotation


# instance fields
.field final synthetic this$0:Lcom/estrongs/chromecast/ChromeCastImpl;


# direct methods
.method private constructor <init>(Lcom/estrongs/chromecast/ChromeCastImpl;)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/estrongs/chromecast/ChromeCastImpl;Lcom/estrongs/chromecast/ChromeCastImpl$1;)V
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;-><init>(Lcom/estrongs/chromecast/ChromeCastImpl;)V

    return-void
.end method


# virtual methods
.method public onConnected(Landroid/os/Bundle;)V
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {v0}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$700(Lcom/estrongs/chromecast/ChromeCastImpl;)Lcom/google/android/gms/common/api/d;

    move-result-object v0

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    iget-object v0, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {v0}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$800(Lcom/estrongs/chromecast/ChromeCastImpl;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_2

    .line 3
    iget-object v0, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {v0, v1}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$802(Lcom/estrongs/chromecast/ChromeCastImpl;Z)Z

    if-eqz p1, :cond_1

    const-string v0, "com.google.android.gms.cast.EXTRA_APP_NO_LONGER_RUNNING"

    .line 4
    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z

    move-result p1

    if-eqz p1, :cond_1

    .line 5
    iget-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastImpl;->teardown()V

    goto :goto_1

    .line 6
    :cond_1
    iget-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {p1}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$900(Lcom/estrongs/chromecast/ChromeCastImpl;)V

    goto :goto_1

    .line 7
    :cond_2
    :try_start_0
    sget-object p1, Lcom/google/android/gms/cast/e;->c:Lcom/google/android/gms/cast/e$b;

    iget-object v0, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {v0}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$700(Lcom/estrongs/chromecast/ChromeCastImpl;)Lcom/google/android/gms/common/api/d;

    move-result-object v0

    const-string v2, "43597A76"

    invoke-interface {p1, v0, v2, v1}, Lcom/google/android/gms/cast/e$b;->a(Lcom/google/android/gms/common/api/d;Ljava/lang/String;Z)Lcom/google/android/gms/common/api/e;

    move-result-object p1

    new-instance v0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks$1;

    invoke-direct {v0, p0}, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks$1;-><init>(Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;)V

    invoke-virtual {p1, v0}, Lcom/google/android/gms/common/api/e;->a(Lcom/google/android/gms/common/api/i;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    move-exception p1

    const-string v0, "ChromeCastImpl"

    const-string v1, "Failed to launch application"

    .line 8
    invoke-static {v0, v1, p1}, Les/w70;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 9
    iget-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastImpl;->teardown()V

    .line 10
    iget-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {p1}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$200(Lcom/estrongs/chromecast/ChromeCastImpl;)Ljava/lang/Object;

    move-result-object p1

    monitor-enter p1

    .line 11
    :try_start_1
    iget-object v0, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {v0}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$1200(Lcom/estrongs/chromecast/ChromeCastImpl;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_3

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/estrongs/chromecast/ChromeCastConnectionListener;

    .line 12
    invoke-interface {v1}, Lcom/estrongs/chromecast/ChromeCastConnectionListener;->onConnectionFailed()V

    goto :goto_0

    .line 13
    :cond_3
    monitor-exit p1

    :goto_1
    return-void

    :catchall_0
    move-exception v0

    monitor-exit p1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_3

    :goto_2
    throw v0

    :goto_3
    goto :goto_2
.end method

.method public onConnectionSuspended(I)V
    .locals 2

    .line 1
    iget-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    const/4 v0, 0x1

    invoke-static {p1, v0}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$802(Lcom/estrongs/chromecast/ChromeCastImpl;Z)Z

    .line 2
    iget-object p1, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {p1}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$200(Lcom/estrongs/chromecast/ChromeCastImpl;)Ljava/lang/Object;

    move-result-object p1

    monitor-enter p1

    .line 3
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/chromecast/ChromeCastImpl$ConnectionCallbacks;->this$0:Lcom/estrongs/chromecast/ChromeCastImpl;

    invoke-static {v0}, Lcom/estrongs/chromecast/ChromeCastImpl;->access$1200(Lcom/estrongs/chromecast/ChromeCastImpl;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/estrongs/chromecast/ChromeCastConnectionListener;

    .line 4
    invoke-interface {v1}, Lcom/estrongs/chromecast/ChromeCastConnectionListener;->onConnectionSuspended()V

    goto :goto_0

    .line 5
    :cond_0
    monitor-exit p1

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_2

    :goto_1
    throw v0

    :goto_2
    goto :goto_1
.end method
